package descentFly.app.managePanel
{
	import UIFree.uif_component;
	
	import descentFly.app.df_component;
	import descentFly.app.df_label;
	
	import flash.geom.Rectangle;
	
	public class df_paramItem extends df_component {
		public static var HEIGHT		: int = 26;
		public static var NAMEPERCENT 	: Number = 0.7;
		
		private var _label: df_label;
		private var _value: df_label;
		
		public function df_paramItem(parent:uif_component, nameParametr: String, valueParametr: Object, ax:int=0, ay:int=0, awidth:int=0, styleClass:Object='') {
			super(parent, ax, ay, awidth, HEIGHT, styleClass);
			_label.text = nameParametr;
			value = valueParametr.toString();
		}
		
		public function set value(a_value: String): void {
			_value.text = a_value;
		}
		
		public function get value(): String {
			return _value?_value.text:'';
		}
		
		override protected function createComponents(layer:df_component, inner:Rectangle):void {
			var inner: Rectangle = layer.getInner();
			inner.width *= NAMEPERCENT;
			_label = new df_label(layer, inner.x, inner.y, inner.width, HEIGHT, style.label);
			inner = layer.getInner(inner.width) 
			_value = new df_label(layer, inner.x, inner.y, inner.width, HEIGHT, style.value);
		}
	}
}